xen: re-define assign_pages and introduce a new function assign_page
authorPenny Zheng <penny.zheng@arm.com>
Fri, 10 Sep 2021 02:52:13 +0000 (02:52 +0000)
committerStefano Stabellini <stefano.stabellini@xilinx.com>
Mon, 13 Sep 2021 21:12:59 +0000 (14:12 -0700)
commit5260e8fb93f0e1f094de4142b2abad45844ab89c
treedd16ae1cf444b8245630bc52d53f0f565d529cb1
parent4a9e73e6e53e9d8bc005a08c3968ec36d793f140
xen: re-define assign_pages and introduce a new function assign_page

In order to deal with the trouble of count-to-order conversion when page number
is not in a power-of-two, this commit re-define assign_pages for nr pages and
assign_page for original page with a single order.

Backporting confusion could be helped by altering the order of assign_pages
parameters, such that the compiler would point out that adjustments at call
sites are needed.

[stefano: switch to unsigned int for nr]
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/x86/pv/dom0_build.c
xen/common/grant_table.c
xen/common/memory.c
xen/common/page_alloc.c
xen/include/xen/mm.h